package com.go8.admin.goods.controller;

import com.go8.common.service.ServiceResponse;
import com.go8.common.util.UUIDUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/admin")
public class UserController {
    @PostMapping("login")
    public Object login(String userName,String password){
        Map<String,Object> map = new HashMap<>();
        map.put("token", UUIDUtils.getUUID());
        return ServiceResponse.ok(map);
    }

    @PostMapping("logout")
    public Object logout(String token){
        return ServiceResponse.ok();
    }

    @GetMapping("get_info")
    public Object getUserInfo(String token){
        Map<String,Object> map = new HashMap<>();
        map.put("avator", "http://10.101.219.110/group1/M00/00/00/CmXbDl-qRX2AUAf8AABtWlbMv0M193.jpg");
        map.put("user_name", "陈吉林");
        map.put("user_id", "123");
        String[] acc = {"super_admin", "admin"};
        map.put("access",acc );
        return ServiceResponse.ok(map);
    }
}
